import java.util.*;

/* Possible time an event can occur */
public class EventPossibility {
    public long start_time;
    public long end_time;
    public ArrayList<ISchedulable> schedulables;

    private int mandatoryCount;

    public int getMandatoryCount() {
	return mandatoryCount;
    }

    public String toString() {
	String r = new String();
	r += "[";
	for(ISchedulable s : schedulables) {
	    r += s.getID() + " ";
	}
	
	r += start_time + "-" + end_time;

	r += "]";
	return r;
    }

    public EventPossibility(long start_time, ISchedulable s) {
	this.mandatoryCount = s.getPriority();
	schedulables = new ArrayList<ISchedulable>();
	schedulables.add(s);
	this.start_time = start_time;
	this.end_time = 0;
    }	

    public EventPossibility(long start_time, EventPossibility base, ISchedulable s) {
	this.mandatoryCount = s.getPriority() + base.getMandatoryCount();
	this.schedulables = new ArrayList<ISchedulable>(base.schedulables);
	this.schedulables.add(s);
	this.start_time = start_time;
	this.end_time = 0;
    }	
}   
